import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import RegisterView from '../views/RegisterView.vue'
import LoginView from '../views/LoginView.vue'
import HomeBanner from '../views/HomeViews/HomeBanner.vue'
import ListView from '../views/ListView.vue'
import DetailView from '../views/DetailView'
import CartView from '../views/CartView'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        component: HomeView,
        children: [
            {
                path: '/',
                name: 'home',
                component:HomeBanner
            }
        ]
    },
    {
        path: '/register',
        name: 'RegisterView',
        component: RegisterView
    },
    {
        path: '/login',
        name: 'LoginView',
        component: LoginView
    },
    {
        path: '/list:type_one',
        name: 'ListView',
        component: ListView
    },
    {
        path: '/detail:goodId',
        name: 'DetailView',
        component: DetailView
    },
    {
        path: '/cart',
        name: 'CartView',
        component: CartView
    },


    //   {
    //     path: '/about',
    //     name: 'about',
    //     component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    //   }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
